<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  var foo = function () {
    console.log(111)
  }
  var x = function bar() {
    console.log('bar');
  }

  foo();
  x();


  var a = 10;
  (function(){
    console.log(a);
    var a = 100;
  })();
</script>
</body>
</html>